#pragma once
#ifndef LIT__FILE__PARSER__HH__
#define LIT__FILE__PARSER__HH__

#include <LitPrerequisites.h>

namespace Lit
{
	class LIT_API FileLineParser
	{
	public:
		struct Line
		{
			String line;
			size_t		id;
		};

	protected:
		std::ifstream	mStream;
		size_t			mRefLine;
	public:
		FileLineParser( const String &filename, bool binary = false );
		FileLineParser( );
		virtual ~FileLineParser( );

		operator bool() const;

		bool isOpen() const;
		bool isGood() const;

		size_t getCurrentLine( ) const;

		bool eof() const;

		FileLineParser& operator >>( Line& line );
		FileLineParser& operator >>( String& line );

		bool open( const String &filename, bool binary = false );
		bool close();
	};
};

#endif